package com.zy.edu.controller;

import com.zy.edu.service.CourseChapterExercisesStuService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * @author: HuangHaiShui
 * @description:
 * @date: 2021/8/17 14:22
 * @version: 1.0
 */
@Controller
public class TestController {
    @Resource
    CourseChapterExercisesStuService courseChapterExercisesStuService;

    @RequestMapping("/test")
    @ResponseBody
    public Map importTest(   ){

        Map map = new HashMap();
        map.put("code",0);
        try {
            String userId="u-83ea1ca9e2cf464397bc6f2339c96a54";
            String exerciseRate = courseChapterExercisesStuService.getExerciseRate(userId);

            map.put("data",exerciseRate);
            map.put("code",1);
        }catch (Exception e){
            e.printStackTrace();
            map.put("msg",e.getMessage());
        }
        return map;
    }

}
